package com.wswy.wyjk.ui.uitls;

import android.content.Context;
import android.support.annotation.NonNull;
import com.meituan.android.walle.WalleChannelReader;
import com.raft.framework.BaseAppContext;
import com.wswy.wyjk.BuildConfig;


public class ChannelManager {

  private static final String DEFAULT_CHANNEL = BuildConfig.CHANNEL;

  private static String sChannel;

  public static @NonNull
  String getChannel(Context context){
    if(sChannel == null){
      sChannel = WalleChannelReader.getChannel(context);
    }
    if(sChannel == null){
      sChannel = DEFAULT_CHANNEL;
    }
    return sChannel;
  }

  public static @NonNull String getChannel(){
    if(sChannel == null){
      return getChannel(BaseAppContext.getContext());
    }
    return sChannel;
  }

}
